#pragma once
#include "GameObject.h"
#include "Playfield.h"
#include "PlayerInput.h"
#include "GameMode.h"

enum PlayerPosition {PP_LEFT, PP_RIGHT};

class Player :
	public GameObject
{
public:
	Player(PlayerPosition pos, 
		PlayerInput *pInput, 
		VisualObject* rep, 
		Playfield &playfield,
		GameMode &gamemode);
	~Player(void);

	virtual void getReadyForDraw();
	bool canComeOutOfIntro();
	const int getHeight() { return representation->getHeight(); }
	const int getWidth() { return representation->getWidth(); }

	virtual void update(const double time);
	void scorePoint();
	void reset();
	void increaseSpeed();

	void updateIntro(const double time);
	void updatePlay(const double time);

private:
	PlayerInput* playerinput;
	PlayerPosition playerposition;
	Playfield &playfield;
	GameMode &gamemode;

	bool targetReached;
	int score;
	int targetX;
	double speed;
	double realY, realX;
};
